using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Cliente.Objetos;

namespace Cliente.Forms
{
    public partial class FormBuscaEndereco : Form
    {
        public TextBox oCepDest;
        public FormBuscaEndereco()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Controller.Endereco cEnd = new Controller.Endereco();
            dgEndereco.DataSource = cEnd.CepPorNome(tbxRua.Text);
        }

        private void dgEndereco_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex > -1)
            {
                App._oTbxCep.Text = this.dgEndereco.Rows[e.RowIndex].Cells[0].Value.ToString();
                this.Close();
            }
        }
    }
}